{include file="User@Public:header"/}
<link rel="stylesheet" type="text/css" href="__CSS__/login.css"/>
<div class="container-lg centered mt60">
	<div class="col-xs-12 col-md-12 col-lg-10 col-lg-offset-1">
		<div class="panel-green panel-half">
			<div class="row">
				<div class="col-sm-12 col-md-6">
					<div class="panel-form p30 active">
						<div class="tac mt10">
							<h1>
								用户注册
							</h1>
						</div>
						<hr />
						<div class="mt20">
							<form action="__SELF__" method="post" class="form form-horizontal regsiter">
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">账　　号</span>
										<input class="form-control" id="username" placeholder="请填写账号" name="username" type="text" value="" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">密　　码</span>
										<input class="form-control" id="password" placeholder="请填写密码" name="password" type="password" value="" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">确认密码</span>
										<input class="form-control" id="repassword" placeholder="确认密码" name="repassword" type="password" value="" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">邮　　箱</span>
										<input class="form-control" id="email" placeholder="请填写邮箱" name="email" type="text" value="" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">验&nbsp;证&nbsp;码&nbsp;</span>
										<input class="form-control" id="verify" placeholder="请填写验证码" name="verify" type="text" />
										<span class="input-group-addon input-group-image"><img class="verifyimg reloadverify" alt="点击切换" src="{:U('verify')}" style="cursor:pointer; height: 40px"></span>
									</div>
								</div>
								<div class="tar mt40 mb10">
									<a class="btn txt-link mr5" href="{:U('User/Public/login')}">已有账号点此登录？</a>
									<button class="btn btn-submit btn-lg ajax-post" target-form="regsiter" type="submit" >注册</button>
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="col-sm-12 col-md-6">
					<div class="p30">
						<h2 class="txt-green">
							第三方登录
						</h2>
						<hr />
						<div class="row mt20">
						{:hook('SyncLogin')}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(document)
	.ajaxStart(function(){
	$("button:submit").addClass("btn-loading").attr("disabled", true).text('loading...');
	})
	.ajaxStop(function(){
	$("button:submit").removeClass("btn-loading").attr("disabled", false).text('注 册');
	});
	$("form").submit(function(){
	var self = $(this);
	$.post(self.attr("action"), self.serialize(), success, "json");
	return false;
	function success(data){
	if(data.status){
	window.location.href = data.url;
	} else {
	self.find(".Validform_checktip").addClass('alert').text(data.info);
	setTimeout(function(){
	self.find(".Validform_checktip").removeClass('alert').text('');
	},3000);
	//刷新验证码
	$(".reloadverify").click();
	}
	}
	});
	$(function(){
	var verifyimg = $(".verifyimg").attr("src");
	$(".reloadverify").click(function(){
	if( verifyimg.indexOf('?')>
	0){
	$(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
	}else{
	$(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
	}
	});
	});
</script>
{include file="User@Public:footer"/}
